home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ThreadUtilities.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __THREADUTILITIES__
- #define __THREADUTILITIES__
-
- #ifndef THREAD_H
- // #include "Thread.h"
- #endif
-
- #ifndef __NEWDELETE__
- #include "NewDelete.h"
- #endif
-
- extern Boolean BreakOnFailures();
-
- #if 0
-
-
- #if defined ( debug ) || defined ( BLJTestTool )
-
- // This definitions override those in Thread.h and output the 'reason'
- // that the exception was called to the keith output stream.
-
- #undef EXCEPTION
- #undef RETRY
- #undef FAIL
- #undef PASSEXCEPTION
- #undef FAILOSErr
- #undef FAILNULL
- #undef FAILifTRUE
- #undef FAILifFALSE
-
- #define EXCEPTION _premoveExceptionHdlr(&__fr);}else{keith<<"EXCEPTN : #"<<EXCEPTIONCODE<<" file "<<__FILE__<<", line "<<__LINE__<<endl;
- #define RETRY() {keith<<"RETRY : file " __FILE__ ", line "<<__LINE__<<endl;_retry(&__fr);}
- #define FAIL(code) {keith<<"FAIL : #"<<code<<", file "<<__FILE__<<", line "<<__LINE__<<endl; if (BreakOnFailures()) BreakStr ("\pFAILURE"); _praiseException(code);}
- #define PASSEXCEPTION() {keith<<"PASSEXCP: #"<<EXCEPTIONCODE<<", file "<<__FILE__<<", line "<<__LINE__<<endl;_praiseException(EXCEPTIONCODE);}
- #define FAILOSErr(code) {OSErr FAILOSERRCODE=code;if(FAILOSERRCODE){keith << "FAIL/OS : #"<<FAILOSERRCODE<<", file "<<__FILE__<<", line "<<__LINE__<<endl; if (BreakOnFailures()) BreakStr ("\pFAILURE"); _failoserr(FAILOSERRCODE);}}
- #define FAILNULL(p) if(!p){keith<<"FAILNULL: file "<<__FILE__<<", line "<<__LINE__<<endl; if (BreakOnFailures()) BreakStr ("\pFAILURE"); _failnull(p);}
- #define FAILifTRUE(p) if(p){keith<<"FAILTRUE: file "<<__FILE__<<", line "<<__LINE__<<endl; if (BreakOnFailures()) BreakStr ("\pFAILURE"); _failoserr(-1);}
- #define FAILifFALSE(p) if(!p){keith<<"FAILFALS: file "<<__FILE__<<", line "<<__LINE__<<endl; if (BreakOnFailures()) BreakStr ("\pFAILURE"); _failoserr(-1);}
-
- #else
-
- #define FAILifTRUE(p) if(p)_failoserr(-1)
- #define FAILifFALSE(p) if(!p)_failoserr(-1)
-
- #endif // !(debug || BLJTestTool)
-
- #endif
-
-
- #endif // __THREADUTILITIES__
-
-